<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "base_sys_preview_angle".
 *
 * @property integer $id
 * @property integer $pid
 * @property integer $img_small_id
 * @property integer $img_thumb_id
 * @property integer $img_url_id
 */
class ItemPreviewAngle extends \yii\db\ActiveRecord
{
	public $file;
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'base_sys_preview_angle';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['pid', 'img_small_id', 'img_thumb_id', 'img_url_id'], 'integer'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'pid' => 'Pid',
            'img_small_id' => 'Img Small ID',
            'img_thumb_id' => 'Img Thumb ID',
            'img_url_id' => 'Img Url ID',
            'file' => Yii::t('app','Image File'),
        ];
    }
    public function getUrlImage()
    {
    	return $this->hasOne(Image::className(),['id'=>'img_url_id']);
    }
    public function getThumbImage()
    {
    	return $this->hasOne(Image::className(),['id'=>'img_thumb_id']);
    }
    public function getSmallImage()
    {
    	return $this->hasOne(Image::className(),['id'=>'img_small_id']);
    }
}
